home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Day Cry
/
Day Cry CD.bin
/
oh_towns
/
ein
/
sources
/
einlib.lzh
/
LIBSRC.LZH
/
EIN_PAL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-09-05
|
3KB
|
121 lines
/*<Header>==============================================================
*
* FILE MANAGER / "EIN_PAL.C"
*
* [ EIN(tm) project : âpâîâbâgæÇì∞òΓÅòè╓ÉöîQ ]
*
* COPYRIGHT Nam 1994, All rights reserved.
*
*-----------------------------------------------------------------------
* V1.0L01â┐ 94.07.06/Nam âvâìâgâ^âCâv
* V1.0L01â└ 94.08.31/Nam 32KÉFé┼é╠ÉFé╕éΩÅCÉ│
*</Header>==============================================================*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <snd.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
#include <egb.h>
#include <msdos.cf>
#include <loader.h>
#include <math.h>
#include <io.h>
#include <guidbg.h>
#define EIN_PAL
#include "..\eintm.h"
#ifndef NOERR
#define NOERR (0)
#endif
#ifndef ERROR
#define ERROR (1)
#endif
/*<Func>================================================================
* int EIN_initGuiColor()
*
* üyèT ùvüz GUIâpâîâbâgâeü[âuâïé≡âüâjâàü[ÉFé╔ìçéφé╣éΘ
*
* üyï@ ö\üz
*
* üyôⁿ ù═üz é╚é╡
*
* üyÅo ù═üz é╚é╡
*
* üyè╓ÉöÆlüz == 0 É│ÅφÅIù╣
*
* üyÆì ê╙üz Åëè·ë╗Ä₧é╔êΩôxé╛é»Ä└ìsé╡é─é¡é╛é│éóüB
* â^âCâ~âôâOé═'MMI_Init()'é╠îπé┼üAé⌐é┬GUIòöòié≡ò\Īé╖éΘæOé┼é╖üB
*
* üyÄQ Å╞üz
*
*-----------------------------------------------------------------------
* V11L10 1994.07.06/Nam
*</Func>==============================================================*/
int EIN_initGuiColor()
{
static int ct32k[16] = {
// 0x00000000, 0x5caf5caf, 0x02200220, 0x02310231,
// 0x63186318, 0x640e640e, 0x63186318, 0x42104210,
// 0x04210421, 0x76377637, 0x03e003e0, 0x03ff03ff,
// 0x7c007c00, 0x7c1f7c1f, 0x07fa07fa, 0x7fff7fff
0x00000000, 0x3cb73cb7, 0x37293729, 0x67f567f5,
0x4e734e73, 0x640f640f, 0x67396739, 0x3def3def,
0x14a514a5, 0x5e3b5e3b, 0x03600360, 0x00150015,
0x2d6b2d6b, 0x7c1f7c1f, 0x6fe06fe0, 0x7fff7fff
};
static int ct16m[16] = {
0x00000000, 0x00b02070, 0x0040c060, 0x00a0f0c0,
0x00909090, 0x007000c0, 0x00c0c0c0, 0x00707070,
0x00202020, 0x00e080b0, 0x0000d000, 0x00a00000,
0x00505050, 0x00f000f0, 0x0000f0d0, 0x00ffffff
};
typedef struct __PALVAL{
unsigned int colorNo; /* ô╟é▌ĵé┴é╜âüâjâàü[ÉFö╘ìå */
char blue; /* É┬é╠èKÆ▓(0ü`255) */
char red; /* É╘é╠èKÆ▓(0ü`255) */
char green; /* ù╬é╠èKÆ▓(0ü`255) */
char eop; /* âfü[â^ÅIù╣(0) */
}_PALVAL;
typedef struct __MENUPAL{
unsigned int maxcolor; /* ô╟é▌ĵé┴é╜âüâjâàü[ÉFé╠æìÉö */
_PALVAL c[16]; /* âpâîâbâgâfü[â^ */
}_MENUPAL;
_MENUPAL pal;
unsigned int *tbl;
register int i, j, ret;
// âüâjâàü[ÉFé≡ĵô╛
pal.maxcolor = 0;
ret = EGB_getTmenuPalette( &pal ) ;
#ifdef DEBUG
printf("EIN_setGuiColor: ret=%d, palmax=%d\n", ret, pal.maxcolor);
#endif
// 256ÉFé╠ÅΩìç
tbl = MG_getColorTable( 1 ) ; /* 256 */
for( i = 0 ; i < 16 ; i++ ) {
tbl[i] = i + (i << 8) + (i<<16) + (i << 24 ) ;
}
// 32ké╠ÅΩìç
tbl = MG_getColorTable( 2 ) ; /* 32k */
for( i=0; i<16; i++ ){
tbl[i] = ct32k[i];
}
// 16Mé╠ÅΩìç
tbl = MG_getColorTable( 3 ) ; /* 16M */
for( i=0; i<16; i++ ){
tbl[i] = ct16m[i];
}
return NOERR;
}